$(function () {

    var salechart_datagrid = $("#salechart_datagrid");

    salechart_datagrid.datagrid({
        fit: true,
        fitColumns: true,
        striped: true,
        url: "/chart/querySale.do",
        pagination: true,
        singleSelect: true,
        toolbar: "#salechart_toolbar",
        rownumbers:true,
        columns: [[
            {field: 'groupType', title: '分组类型', width: 180, align: 'center'},
            {field: 'totalAmount', title: '销售总金额', width: 180, align: 'center'}
        ]]
    });
});

function doSearch(){
    var organId = $("#organization").combobox('getValue');
    var productId = $("#product").combobox('getValue');
    var minDate = $("#minDate").datebox('getValue');
    var maxDate = $("#maxDate").datebox('getValue');
    var groupType = $("#groupType").combobox('getValue');
    $("#salechart_datagrid").datagrid("load",{
        organId:organId,
        productId:productId,
        minDate:minDate,
        maxDate:maxDate,
        groupType:groupType
    });
}
